﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             xmlns:xCelViewControls="clr-namespace:nRoute.Samples.OfficerXcel.ViewServices.Controls;assembly=OfficerXcel.Infrastructure"
             xmlns:xCelContent="clr-namespace:nRoute.Samples.OfficerXcel.Views;assembly=OfficerXcel.Content"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:n="http://nRoute/schemas/2010/xaml"
             xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
             x:Class="nRoute.Samples.OfficerXcel.Shell"
             d:DesignWidth="820"
             d:DesignHeight="480"
             MinWidth="650"
             MinHeight="450">

    <i:Interaction.Behaviors>
        <n:BridgeViewModelBehavior />
    </i:Interaction.Behaviors>

    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ShellViewStateGroup">
                <VisualState x:Name="BackStageState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00"
                                                       Duration="00:00:00.0010000"
                                                       Storyboard.TargetName="ContentView"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="border"
                                                      Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="#00B6BABF" />
                        </ColorAnimationUsingKeyFrames>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="border"
                                                      Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="Transparent" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="ContentState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00"
                                                       Duration="00:00:00.0010000"
                                                       Storyboard.TargetName="BackStageView"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0">
                <GradientStop Color="#FFE0E0E0"
                              Offset="0.919" />
                <GradientStop Color="White"
                              Offset="0.011" />
            </LinearGradientBrush>
        </Grid.Background>

        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Loaded">
                <ic:GoToStateAction StateName="BackStageState" />
            </i:EventTrigger>
            <n:ReverseCommandTrigger ReverseCommand="{Binding ShowWorksheetReverseCommand, Mode=OneWay}">
                <ic:GoToStateAction StateName="ContentState" />
            </n:ReverseCommandTrigger>
        </i:Interaction.Triggers>

        <Grid x:Name="Header"
              Height="24"
              Margin="0"
              VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="138" />
                <ColumnDefinition />
                <ColumnDefinition Width="143" />
            </Grid.ColumnDefinitions>
            <TextBlock x:Name="Title"
                       Text="{Binding Title, Mode=OneWay}"
                       FontFamily="Arial"
                       FontSize="13.333"
                       TextAlignment="Center"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Grid.Column="1" />
        </Grid>
        <Path Stretch="Fill"
              Stroke="#FFB9BABE"
              Height="1"
              HorizontalAlignment="Left"
              Margin="0,43,0,0"
              VerticalAlignment="Top"
              UseLayoutRounding="False"
              Data="M317,11 L406.35883,11" />
        <StackPanel x:Name="Ribbon"
                    Margin="0,20,0,0"
                    VerticalAlignment="Top"
                    Orientation="Horizontal">

            <!-- FILE TAB -->
            <Border Height="24"
                    HorizontalAlignment="Left"
                    Margin="10,0,0,0"
                    VerticalAlignment="Top"
                    Width="59"
                    BorderBrush="#FF4A971F"
                    BorderThickness="1,1,1,0"
                    CornerRadius="2,2,0,0"
                    Cursor="Hand">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <ic:GoToStateAction StateName="BackStageState" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF68DE35"
                                      Offset="0.059" />
                        <GradientStop Color="#FF439815"
                                      Offset="0.823" />
                    </LinearGradientBrush>
                </Border.Background>
                <Border>
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.951,0.421"
                                             StartPoint="0.108,0.447">
                            <GradientStop Offset="0.029"
                                          Color="#26000000" />
                            <GradientStop Color="#33000000"
                                          Offset="1" />
                            <GradientStop Color="#00696969"
                                          Offset="0.437" />
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="File"
                               TextWrapping="Wrap"
                               Foreground="White"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               Margin="0,-2,0,0" />
                </Border>
            </Border>

            <!-- HOME TAB -->
            <Border x:Name="border"
                    Height="24"
                    HorizontalAlignment="Left"
                    Margin="10,0,0,0"
                    VerticalAlignment="Bottom"
                    Width="59"
                    BorderBrush="#FFB6BABF"
                    BorderThickness="1,1,1,0"
                    Background="White"
                    CornerRadius="2,2,0,0"
                    Cursor="Hand">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <ic:GoToStateAction StateName="ContentState" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <TextBlock Text="Home"
                           TextWrapping="Wrap"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center" />
            </Border>

        </StackPanel>
        <Grid Margin="0,44,0,0"
              x:Name="ContentView">

            <!-- WORKSHEET -->
            <xCelContent:WorksheetView Grid.Row="1"
                                       d:LayoutOverrides="Width, Height"
                                       Margin="0,0,0,24" />

            <!-- STATUS BAR -->
            <Border x:Name="StatusBar"
                    BorderBrush="#FFB6BABF"
                    BorderThickness="0,1,0,0"
                    Height="24"
                    VerticalAlignment="Bottom">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FFE8EBEF"
                                      Offset="0.875" />
                        <GradientStop Color="White" />
                    </LinearGradientBrush>
                </Border.Background>
                <TextBlock x:Name="StatusText"
                           Margin="12,0"
                           VerticalAlignment="Center"
                           Text="Ready" />
            </Border>

        </Grid>
        <Grid Margin="0,44,0,0"
              x:Name="BackStageView"
              Background="White">

            <Image HorizontalAlignment="Right"
                   VerticalAlignment="Bottom"
                   Source="Resources/SideBkg.png"
                   Stretch="None"
                   IsHitTestVisible="False" />

            <Border Grid.ColumnSpan="1"
                    Grid.RowSpan="1"
                    BorderBrush="{x:Null}"
                    BorderThickness="0,0,0,0"
                    Margin="132,0,0,0"
                    HorizontalAlignment="Left">

                <!-- APPLICATION DEFAULT CONTAINER, WITH CUSTOM TEMPLATE -->
                <n:StatefulBrowsingContainer x:Name="DefaultContainer"
                                                           Style="{StaticResource OfficerContainerStyle}"
                                                           Url="Dialogs/NewDialog">
                    <i:Interaction.Behaviors>
                        <n:NavigationHandlerBehavior IsDefaultHandler="True" />
                    </i:Interaction.Behaviors>
                </n:StatefulBrowsingContainer>

            </Border>

            <ListBox x:Name="LinksListBox"
                     Margin="0"
                     BorderThickness="0,0,0,0"
                     SelectionMode="Single"
                     BorderBrush="{x:Null}"
                     ItemsSource="{Binding SiteMapNodes}"
                     Style="{StaticResource LinksListBoxStyle}"
                     ItemTemplate="{StaticResource LinkTemplate}"
                     ItemContainerStyle="{StaticResource LinkContainerStyle}"
                     HorizontalAlignment="Left"
                     Width="132"
                     Grid.ColumnSpan="1"
                     Grid.RowSpan="1"
                     Grid.Column="0"
                     Background="#FFF1F2F4">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Loaded">
                        <n:SetPropertyAction PropertyName="SelectedIndex"
                                                      Value="1" />
                    </i:EventTrigger>
                    <i:EventTrigger EventName="SelectionChanged">
                        <n:ExecuteSiteMapNodeAction SiteMapNode="{Binding SelectedItem, ElementName=LinksListBox, Mode=OneWay}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <ListBox.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="Black"
                                      Offset="0" />
                        <GradientStop Color="Black"
                                      Offset="1" />
                    </LinearGradientBrush>
                </ListBox.Foreground>
            </ListBox>

            <Path Stretch="Fill"
                  Height="2"
                  VerticalAlignment="Top"
                  UseLayoutRounding="False"
                  Data="M113,72 L478.66241,72"
                  StrokeThickness="2"
                  Margin="-0.5,0,0,0">
                <Path.Stroke>
                    <LinearGradientBrush EndPoint="1.01,0"
                                         StartPoint="-0.01,2">
                        <GradientStop Color="#FF64D134"
                                      Offset="0.375" />
                        <GradientStop Color="White"
                                      Offset="1" />
                        <GradientStop Color="#FF346C15" />
                    </LinearGradientBrush>
                </Path.Stroke>
            </Path>

        </Grid>

        <!-- HEADER -->
        <xCelViewControls:HeaderNotification VerticalAlignment="Top"
                                             Margin="0,43,0,0" />

        <!-- BALLOON -->
        <xCelViewControls:BalloonNotification Margin="0,0,35,23"
                                              VerticalAlignment="Bottom"
                                              HorizontalAlignment="Right" />

    </Grid>
</UserControl>